﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.ComponentModel;
//using System.Net.NetworkInformation;
//using Microsoft.Practices.EnterpriseLibrary.Validation;

//namespace Skynet.BusinessEntities
//{
//    public partial class Author : IEditableObject, IDataErrorInfo
//    {
//        public Author()
//        {
//            this._propertyChanged += new PropertyChangedEventHandler(Author__propertyChanged);
//        }

//        void Author__propertyChanged(object sender, PropertyChangedEventArgs e)
//        {
//            if (e.PropertyName == "WebSite" && string.IsNullOrWhiteSpace(this.WebSite))
//            {
//                //throw new ApplicationException("web site not valid");

//                Ping pingSender = new Ping();
//                PingOptions options = new PingOptions();                
//                //PingReply reply = pingSender.Send(this.WebSite);
//                //if (reply.Status != IPStatus.Success)
//                //{
                
//                //}  
//            }
//        }

//        #region IEditableObject Members
//        public void BeginEdit()
//        {           
            
//            this.ChangeTracker.OriginalValues["FirstName"] = this.FirstName;
//            this.ChangeTracker.OriginalValues["LastName"] = this.LastName;
//            this.ChangeTracker.OriginalValues["WebSite"] = this.WebSite;            
//        }

//        public void CancelEdit()
//        {
//            this.ChangeTracker.OriginalValues["FirstName"] = this.FirstName;
//            this.ChangeTracker.OriginalValues["LastName"] = this.LastName;
//            this.ChangeTracker.OriginalValues["WebSite"] = this.WebSite;
//            this.MarkAsUnchanged();
//        }

//        public void EndEdit()
//        {
//            this.MarkAsModified();


//        }

//        #endregion    
    
         
    
//        public string Error
//        {
//            get { return "";   }
//        }

//        public string this[string columnName]
//        {
//            get {
//                var results = Validation.ValidateFromConfiguration<Author>(this, "BusinessLogicAuthor");
//                StringBuilder error = new StringBuilder();
//                foreach (ValidationResult result in results)
//                {
//                    error.AppendLine(result.Message);
//                }
//                return error.ToString();       
//            }
//        }
//    }
//}
